<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of showStatistik
 *
 * @author christiangreweling
 */
class Zend_View_Helper_ShowAnalyticalWinnerCake extends Zend_View_Helper_Abstract {

    //put your code here


    public function showAnalyticalWinnerCake($statsCake = null, $color = null) {
        $winner = $this->view->translate('Victories');

        $html = '';
        if ($statsCake != null) {

            $html.='<script>';

            $html.='$(document).ready(
            function () {
            $.jqplot("analyticalCake",';
            //hier werden die stats eingeladen 
            $html.=$statsCake;

            $html.='             
                 ,{ seriesColors: ';
                    $html.=$color;
                    $html.='
                ,title: "'.$winner.'",
                seriesDefaults: {
                    renderer: jQuery.jqplot.PieRenderer,
                        rendererOptions: {
                        showDataLabels: true,
                        sliceMargin: 3,
                        dataLabels:"value"       
                        }
                },
                grid:{
                background: "transparent",
                 borderWidth: 1.0
                 

                },
                legend: { show:true, location: "e" }
            }
            );
              });';


            $html.= '</script>';

            $html.='<div id="analyticalCake" > </div>';
        }





        return $html;
    }

}

?>
